# pragma once
# include <stdint.h>
# include <string>
# include <functional>
class Client;
class QString;
class App;
enum CustomHeader {
	UnKnown = 0,
	Message,
	VideoFrame,
	AudioFrame,
	EncodeContext,
};

class MessageHandle {
public:
	MessageHandle(App* _app);
	void parse(char* _key, std::string _payload);
	void sendEncodeContext(Client* _client, int conv, uint8_t* _data, size_t _size);
	void sendVideoData(Client* _client, int conv, uint8_t* _data, size_t _size);
	~MessageHandle() = default;
	std::function<void(const QString&)> output;
private:
	void sendData(Client* _client, int conv, CustomHeader _header, uint8_t* _data, size_t _size);
	App* m_app = nullptr;
};
